import React from 'react';
import { useRoutes } from 'react-router-dom';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import routes from './routes';
import './styles/global.less';

const App: React.FC = () => {
  // 使用useRoutes钩子渲染路由
  const element = useRoutes(routes);

  return (
    <ConfigProvider
      locale={zhCN}
      theme={{
        token: {
          colorPrimary: '#1890ff',
          borderRadius: 4,
        },
      }}
    >
      {element}
    </ConfigProvider>
  );
};

export default App;